package com.yonyou.cyxdms.sysAuth.service.controller.manage.favorite;

import com.yonyou.cyx.framework.controller.base.BaseController;
import com.yonyou.cyxdms.sysAuth.service.service.favorite.MenuFavoriteService;
import com.yonyou.cyxdms.sysAuth.service.vo.favorite.FavoriteVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author maxingjian
 * @since 2019-11-06
 */
@Api(value = "收藏", tags = {"收藏"})
@RestController
@RequestMapping("/favorite")
public class FavoriteController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(FavoriteController.class);

    @Autowired
    public MenuFavoriteService menuFavoriteService;

    /**
     * 收藏点击
     *
     * @param:
     * @return:
     * @auther: maxingjian
     * @since: 2019/11/06
     */
    @PutMapping("/point")
    @ApiImplicitParams({@ApiImplicitParam(value = "用户id", name = "userId", required = true, dataType = "string",
            paramType = "header")})
    public FavoriteVO saveFavorite(@RequestBody @Valid FavoriteVO favoriteVO) {
        return menuFavoriteService.saveFavorite(favoriteVO);
    }

}